${page.setTitle("push-center| GOPS")}
<style type="text/css">
    .l-table-edit {}
    .l-table-edit-td{ padding:4px;}
    .l-button-submit,.l-button-reset{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
</style>

<div class="body-pla-content">
  <form action="/classuser/upload" method="post" id="userForm" name="classuser" enctype="multipart/form-data">
   <input type="hidden" name="id" value="${classdefine.id}"/>
        <table class="l-table-edit" >
			 <label>上传文件格式为txt，uid之间用换行间隔</label>
			 <tr>
                <td align="right" >名称：</td>
                <td align="left" >
						<input name="name" type="text" id="name"  maxlength="30" value="${classdefine.name}"  validate="{required:true,maxlength:30}" readonly="true"/>
						<input name="owner" type="hidden" id="owner" value="${webUtil.getNickName()}"/>
						<input name="code" type="hidden" id="code" value="${classdefine.code}" />
				</td>
                <td align="right" >上传文件：</td>
                <td align="left" >
						<input name="file" type="file" id="file"  validate="{required:true}"/>
				</td>
            	<td></td>
            	<td > <input type="button" value="上传" id="subitButton" class="l-button l-button-submit"/>  </td>
            	<td align="left"></td>
            </tr>
        </table>
    </form>
    <form action="">
		<table class="s-table">
			<tr>
				<td>
					<input type="hidden" name="classId"  id="classId" value="${classdefine.id!}"/>
				</td>
			</tr>
		</table>
		</form>
</div>
<body style="padding:6px; overflow:hidden;"> 
  
    <div id="maingrid" style="margin:0; padding:0"></div> 
    <div style="display:none;"> 
  <!-- g data total ttt --> 
</div> 
  
</body> 
<script type="text/javascript">


var grid;
$(function () {
     var columns= [
       				{ display: 'ID', name: 'id', width: 30},
       				{ display: '创建时间', name: 'gmtCreated', width: 100,type:"datetime2"},
//       			{ display: '修改时间', name: 'gmtModified', width: 150,type:"datetime2"},
       				{ display: '文件名字', name: 'fileName', width: 100},
       				{ display: '创建人', name: 'owner', width: 100},
       				{ display: '分组id', name: 'classId' , width: 50},
       				{ display: '分组名称', name: 'className', width: 100},
       				{ display: '上传人数', name: 'totalNum', width: 50},
       				{ display: '成功人数', name: 'successNum', width: 50},
       				{ display: '备注', name: 'memo'}
                   ];
    	
	grid = $("#maingrid").ligerGrid({
						columns:columns,
						checkbox:false,
						enabledSort:false,
						pageSize:10,
						dataAction:'server',
						root:'rows',
						record :'total',
						pageParmName :'page',
						pagesizeParmName :'pageSize',
						width: '100%',
						height:'90%',
						url:'${appServer}/batch/query.json',
						parms : $("form").serializeArray(),
						//parms : [{ name: 'classId', value: ${id} }],
						method:'GET',
						onSuccess:function(data, grid){
							if(data.hasError){
								$.ligerDialog.error(data.message);
							}
						}
					});
     	
});

$(function(){
		$("#subitButton").bind('click',function(){
			
			var name=$("#name").val();
			var file=$("#file").val();
			
			if(file==""){
				$.ligerDialog.error("上传文件不可为空");
				return;
			}
			$("#userForm").submit();
			
		});
	});

</script>
